home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / batch / TSBAT35.ARJ / SHOW.BAT < prev    next >
DOS Batch File  |  1992-04-13  |  1KB  |  59 lines

  1. echo off
  2. rem This is a subroutine which show.bat calls by calling itself
  3. rem Thus a second batch file is not needed
  4. rem The subroutine displays a single file
  5. if not "%2"=="recurse" goto _begin
  6. echo File %1
  7. type %1 | more
  8. echo Strike a key for the next file . . .
  9. pause > nul
  10. goto _out
  11.  
  12. :_begin
  13. echo.
  14. echo ┌───────────────────────────────────────────────────┐
  15. echo │ Type files allowing wildcards                     │
  16. echo │ By Prof. Timo Salmi, ts@chyde.uwasa.fi, 13-Apr-92 │
  17. echo └───────────────────────────────────────────────────┘
  18. echo.
  19.  
  20. rem If no parameters then give the instructions
  21. if "%1"=="" goto _help
  22.  
  23. rem Check that show.bat is available at path or current directory
  24. set _found=no
  25. if exist show.bat set _found=yes
  26. for %%d in (%path%) do if exist %%d\show.bat set _found=yes
  27. if "%_found%"=="no" goto _no_show
  28.  
  29. rem Type the files
  30. :_loop
  31. if not exist %1 goto _err
  32. for %%f in (%1) do %comspec% /e:1024 /c show %%f recurse
  33. shift
  34. if not "%1"=="" goto _loop
  35. goto _out
  36.  
  37. rem Warn if file not found, then try the next
  38. :_err
  39. echo File(s) %1 not found
  40. shift
  41. if not "%1"=="" goto _loop
  42. goto _out
  43.  
  44. :_no_show
  45. echo You must have show.bat at your path (or the current directory)
  46. goto _out
  47.  
  48. rem The instructions "(if everything else fails, then rtfm :-)"
  49. :_help
  50. echo Usage: SHOW [FirstFile] [SecondFile] [...]
  51. echo.
  52. echo Examples: SHOW c:\*.bat
  53. echo           SHOW tsbat.inf *.pas
  54. echo.
  55.  
  56. rem That was the whole shebang
  57. set _found=
  58. :_out
  59.